<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="__PUBLIC__/asset/css/common.css">
    <link href="__PUBLIC__/asset/css/animate.css" rel="stylesheet" type="text/css" media="all">
    <link href="__PUBLIC__/asset/lib/bootstrap/bootstrap.css" rel="stylesheet" type="text/css" media="all">
    <title>{:L('help_title')}</title>
    <style>
        .help-box {
            opacity: 0;
            transition: all .3s;
        }

        .help-box .row {
            margin: 0 auto;
            position: relative;
        }

        /* 左侧产品列表 */
        .help-list {
            width: 100%;
            position: relative;
            margin: 5vh 0;
        }

        .help-nav {
            width: 13vw;
            text-align: center;
            position: absolute;
            top: 0;
            left: 0;
            transform: translateX(-100%);
            font-size: calc(14px + 0.5vw);
            padding: 0 10px;
        }

        .help-left-title {
            background-color: var(--themeColor);
            color: white;
            padding: 20px 0;
        }

        .help-left-nav {
            margin: 0;
            padding: 0;
            border: 1px solid #e4e4e4;
        }

        .help-nav-item {
            padding: 10px 0;
            cursor: pointer;
            transition: all .3s;
        }

        .help-now-item {
            background-color: var(--themeColor);
            color: white;
        }

        .help-nav-item:hover {
            background-color: var(--themeColor);
            color: white;
            scale: 1.2;
        }

        .help-right {
            position: relative;
            padding-left: 50px;
        }

        .help-list-item {
            border-bottom: 1px solid #e4e4e4;
            padding: 5vh 0;
        }

        .help-item-tag {
            background-color: black;
            color: white;
            font-size: calc(14px + 0.1vw);
            width: fit-content;
            padding: 2px 4px;
        }

        .help-item-title {
            font-size: calc(30px + 0.1vw);
            margin: 20px 0;
        }

        .help-item-info,
        .help-time {
            font-size: calc(14px + 0.1vw);
            color: #757575;
        }

        .help-time {
            text-align: right;
        }

        .help-item-btn {
            margin: 20px 0 0 !important;
        }

        .help-more-btn {
            padding: 0;
        }

        .help-item-btn img {
            width: 3vw;
            transition: all .3s;
        }

        .help-item-btn:hover img {
            margin-left: 20px;
        }

        @media screen and (max-width:1400px) {
            .help-nav {
                width: 15vw;
            }
        }

        @media screen and (max-width:768px) {
            .help-box {
                margin-top: 7rem;
            }

            .help-list {
                margin-top: 0;
            }

            .help-page-list {
                padding: 0 20px;
            }

            .help-right {
                padding: 0 !important;
            }

            .help-nav {
                position: relative;
                top: 0;
                left: 0;
                transform: none;
                width: 100%;
            }

            .help-left-title {
                padding: 10px 0;
            }

            .help-left-nav {
                display: flex;
                width: 100%;
                flex-wrap: nowrap;
                overflow-x: auto;
                margin: 20px 0 40px;
            }

            .help-nav-item {
                white-space: nowrap;
                padding: 10px 20px;
            }

            .help-item-title {
                font-size: calc(20px + 0.1vw);
                margin: 20px 0;
            }
        }
    </style>
</head>

<body>
    <div class="header"></div>
    <div class="help-box">
        <div class="common-top wow fadeInUp">
            <img src="__PUBLIC__/asset/image/help/top.jpg" alt="">
        </div>
        <div class="help-list">
            <div class="row">
                <div class="help-list-left col-lg-2 col-sm-2">
                </div>
                <div class="help-right col-lg-9 col-lg-offset-1 col-sm-9 col-sm-offset-1 wow fadeInUp">
                    <div class="help-nav">
                        <div class="help-left-title">
                            {:L('help_label')}
                        </div>
                        <ul class="help-left-nav">
                        </ul>
                    </div>
                    <div class="help-page-list">
                        <div class="page-list-content">
                            <volist name="posts" id="vo">
                                <div class="help-list-item wow fadeInUp" style="visibility: visible; animation-name: fadeInUp;">
                                    <div class="help-item-tag">{$vo.tag}</div>
                                    <div class="help-item-title">{$vo.title}</div>
                                    <div class="help-item-info">{$vo.info}</div>
                                    <div class="help-item-btn row">
                                        <div class="help-more-btn col-lg-2 col-xs-6 col-sm-3">
                                            <a href="{:U('message/details',['type'=>'help','key'=>$vo['id']])}">
                                                <i class="iconfont icon-youjiantou- frist-icon"></i>
                                            </a>
                                        </div>
                                        <div class="help-time  col-lg-2 col-lg-offset-8 col-xs-4 col-xs-offset-2 col-sm-4 col-sm-offset-5">
                                            {$vo.time}
                                        </div>
                                    </div>
                                </div>
                            </volist>
                        </div>
                        <!-- 分页器 -->
                        <div class="pagenation-main"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="footer"></div>
</body>

</html>
<script src="__PUBLIC__/asset/lib/wow/wow.min.js"></script>
<script src="__PUBLIC__/asset/lib/jquery_3.2.1.min.js"></script>
<script src="__PUBLIC__/asset/lib/bootstrap/bootstrap.js"></script>
<script src="__PUBLIC__/asset/js/common.js"></script>
<script src="__PUBLIC__/asset/js/help.js"></script>
<script>
    new WOW().init()
    $(document).ready(function () {
        var classList = '{$cates}'
        if(classList != ''){
            classList = JSON.parse(classList)
        }else{
            classList = []
        }


        function changeNav() {
            let cate = '{:I("cate")}'

            $('.help-nav-item').each(function () {
                let id = $(this).data('id')
                if (cate == id) {
                    $(this).addClass('help-now-item')
                } else {
                    $(this).removeClass('help-now-item')
                }
            })
        }

        function bindNav() {
            $('.help-nav-item').each(function () {
                let _this = this
                $(_this).on('click', function () {
                    let id = $(this).data('id')

                    window.location.href = "/help-index-cate-"+id;
                    // $(this).addClass('help-now-item')
                    // $(this).siblings().removeClass('help-now-item')
                })
            })
        }
        function setList() {
            let navDom = ''
            let listDom = ''
            classList.forEach(item => {
                navDom += `
                    <li class="help-nav-item" data-id="${item.id}">${item.value}</li>
                `
            });

            $('.help-left-nav').append(navDom)
            setTimeout(() => {
                changeNav()
                bindNav()
            }, 300);
        }
        setList()
    })

    $(function () {
        $('.pagenation-main').load('../public-pagenation.html?type=help&maxpage={$maxpage}&page={:I("page",1)}');
    });
</script>